def range_gen(range)
       start, hosts = range.split("/")
       hosts  = 2.power!(32 - hosts.to_i)
      
       [IPAddr.new(start).to_i, IPAddr.new(start).to_i+hosts]
end


class Array
   def add_or_update(conn)
       if (conn_update = self.find{|x| x == conn })
           conn_update.update( Time.now )
       else
           self.push(conn)
       end
   end
end

